const EgretCfg = require('./webpack.base.egret.config');
const CreatePluginsCfg = require('./webpack.base.plugins.config');
const TerserPlugin = require('terser-webpack-plugin');
const webpack = require('webpack');

EgretCfg.mode = "production";
delete EgretCfg.devtool;
EgretCfg.plugins.push(
	new webpack.DefinePlugin({
		DEBUG: false,
		RELEASE: true
	}),
	new TerserPlugin({
		terserOptions: {
			compress: {
				drop_console: true,
				drop_debugger: true,
			}
		},
		extractComments: false
	})
);

module.exports = [EgretCfg].concat(CreatePluginsCfg("production"));
